package com.iotproject;

import com.alibaba.excel.EasyExcel;

import java.util.LinkedList;
import java.util.List;

public class testEasyExcel {
    public static void main(String[] args) {
        //写
//        String fileName = "E:\\11.xlsx";
//        EasyExcel.write(fileName, DemoData.class).sheet("学生信息").doWrite(getData());
        //读
        String fileName = "E:\\11.xlsx";
        EasyExcel.read(fileName, ReadData.class, new ExcelListener()).sheet().doRead();
    }

    public static List<DemoData> getData() {
        LinkedList<DemoData> lists = new LinkedList<>();
        for (int i = 0; i < 10; i++) {
            DemoData demoData = new DemoData();
            demoData.setSnt(i);
            demoData.setSname("student" + i);
            System.out.println(demoData);
            lists.add(demoData);
        }
        return lists;
    }

}
